/**
 *  解决IE7无法显示ICON的问题
 */
var Ie7IconPolyfill = function(){
	if(navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion .split(";")[1].replace(/[ ]/g,"")=="MSIE7.0") 
	{ 
		 window.IS_IN_IE7 = true;
		 window.UcsIconFontForIe7 = UcsIconFontForIe7();
	} 
}

/**
 *  这个是为了解决IE7下面iconfont的兼容问题
 */
var UcsIconFontForIe7 = function(){
	var _fontjson = UI_CONST.ICON_FONT_CONST;

	var _process = function(fontjson) {
		var els = document.getElementsByTagName('*'),
			i, c, el;
		for(i = 0;; i += 1) {
			el = els[i];
			if(!el) {
				break
			}
			c = el.className;
			c = c.match(/icon-[^\s'"]+/);
			if(c && fontjson[c[0]]) {
				el.innerHTML = fontjson[c[0]];
			}
		}
	}	
	return {
		process:function(fontjson){
			_process(fontjson||_fontjson);
		}
	}
};
module.exports = Ie7IconPolyfill;